package com.qf.entiy.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qf.entiy.base.BaseDto;


import java.util.Date;

@TableName("goods")
public class Goods extends BaseDto {

    @TableField("name")
    private String name;
    @TableField("merchant_user_id")
    private Long merchantUserId;
    @TableField("goods_type_id")
    private Long goodsTypeId;
    @TableField("pic")
    private String pic;
    @TableField("promote_desc")
    private String promoteDesc;
    @TableField("sku_title")
    private String skuTitle;
    @TableField("sku_cost")
    private String skuCost;
    @TableField("sku_price")
    private String skuPrice;
    @TableField("sku_pmoney")
    private String skuPmoney;
    @TableField("order_num")
    private Long orderNum;
    @TableField("state")
    private Long state;
    @TableField("create_time")
    private Date createTime;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getMerchantUserId() {
        return merchantUserId;
    }

    public void setMerchantUserId(Long merchantUserId) {
        this.merchantUserId = merchantUserId;
    }

    public Long getGoodsTypeId() {
        return goodsTypeId;
    }

    public void setGoodsTypeId(Long goodsTypeId) {
        this.goodsTypeId = goodsTypeId;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getPromoteDesc() {
        return promoteDesc;
    }

    public void setPromoteDesc(String promoteDesc) {
        this.promoteDesc = promoteDesc;
    }

    public String getSkuTitle() {
        return skuTitle;
    }

    public void setSkuTitle(String skuTitle) {
        this.skuTitle = skuTitle;
    }

    public String getSkuCost() {
        return skuCost;
    }

    public void setSkuCost(String skuCost) {
        this.skuCost = skuCost;
    }

    public String getSkuPrice() {
        return skuPrice;
    }

    public void setSkuPrice(String skuPrice) {
        this.skuPrice = skuPrice;
    }

    public String getSkuPmoney() {
        return skuPmoney;
    }

    public void setSkuPmoney(String skuPmoney) {
        this.skuPmoney = skuPmoney;
    }

    public Long getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Long orderNum) {
        this.orderNum = orderNum;
    }

    public Long getState() {
        return state;
    }

    public void setState(Long state) {
        this.state = state;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public enum State {

        PENDING(0L, "待审核"),
        UP(1L, "已上架"),
        DOWN(2L, "已下架");

        private Long code;
        private String description;

        State(Long code, String description) {
            this.code = code;
            this.description = description;
        }

        public Long getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public State get(Long code) {
            for (State state : State.values()) {
                if (state.getCode().equals(code)) {
                    return state;
                }
            }
            return null;
        }

        public State get(String description) {
            for (State state : State.values()) {
                if (state.getDescription().equals(description)) {
                    return state;
                }
            }
            return null;
        }
    }
}
